{% extends 'base.html' %}

{% block head %}
    <title>网站管理-在线不聊天</title>
    <style>

    </style>
{% endblock %}

{% block content %}
<div class="simpleui-box simpleui-row">
    <table>
        <tr>
            <th>序号</th>
            <th>网站名称</th>
            <th>网站URL</th>
            <th>分类</th>
            <th>备注</th>
            <th>创建人</th>
            <th>创建时间</th>
            <th>操作</th>
        </tr>

        {% for website in websites %}
            <tr>
                <td>{{ website.id }}</td>
                <td>{{ website.name }}</td>
                <td>{{ website.url }}</td>
                <td>{{ website.sort.name }}</td>
                <td>{{ website.remark }}</td>
                <td>{{ website.create_user }}</td>
                <td>{{ website.create_time }}</td>
                <td>
                    <a href="/websites/{{ website.id }}"><button>编辑</button></a>
                    <a href="/websites/0"><button>添加</button></a>

                    <form method="POST" action="/websites/{{ website.id }}" style="display: inline-block;">
                        <input type="hidden" name="_method" value="DELETE"><!--由于 form 表单不支持 put/delete , 这个使用参数欺骗-->
                        <input type="submit" name="delete" value="删除" onclick="return confirm('确定要删除吗?')">
                    </form>
                </td>
            </tr>
        {% endfor %}
    </table>
</div>
{% endblock %}
